<template>
	<view class="about-container">
		<view v-if="num==0" class="num0img">
			<image></image>
		</view>
		<!-- sasd -->
		<view v-else>
			<view v-for="(item,index) in items" :key="index" class="xunh">
				<view class="news">
					<view class="newsName" style="font-weight: 900;font-size: 15px;">
						{{item.feedDept}}
					</view>
					<view class="newsTime" style="color: rgb(127,131,137);">{{item.feedTime}}</view>
				</view>
				<img :src="item.feedImg" mode="cover"></img>
				<view class="newscontext">
					<view class="con">{{item.feedContent}}</view>
					<view v-if="item.feedStatus===0" style="color: red;">未解决</view>
					<view v-else style="color: green;">已解决</view>
				</view>

			</view>
		</view>
	</view>
</template>

<script>
import {listFeed} from "@/api/system/feed";

export default {
		data() {
			return {
				num: "",
				name: this.$store.state.user.name,
				url: getApp().globalData.config.appInfo.site_url,
				version: getApp().globalData.config.appInfo.version,
				items: [],
				feed: [],
				queryParams: {
					pageNum: 1,
					pageSize: 999999999,
				},
			}
		},
		created() {
			this.getList();
		},
		methods: {
			getList() {
				listFeed(this.queryParams).then(response => {
					this.feed = response.rows;
					this.items = this.feed.filter(item => item.feedStaff === this.name)

					console.log(response)
					console.log(this.items.length)

					if (this.items.length > 0) {
						this.num = 1;
					} else {
						this.num = 0;
					}
					console.log(this.num)
				});
			},
		},
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff;
	}

	.about-container {
		position: relative;
		background: rgb(245, 245, 245);
		// height: 100vh;

		image {
			position: absolute;
			background-repeat: no-repeat;
			background-size: 550rpx 550rpx;
			left: 100rpx;
			top: 200rpx;
			background-image: url('../../../static/images/sty.jpg');
		}

		.xunh {
			//background: aquamarine;
			margin: 0 30rpx;

			.news {
				//background: darkgoldenrod;
				padding: 35rpx 0 20rpx 0;
				display: flex;
				justify-content: space-between;
			}

			.newscontext {
				display: flex;
				justify-content: space-between;
				padding-bottom: 35rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				border-bottom: black 1px solid;

				.con {
					width: 70vw;
					overflow: hidden;
					text-overflow: ellipsis;
					// white-space: nowrap;
				}
			}

		}

	}
</style>